#ifndef ANIMATED_SPRITE_H
#define ANIMATED_SPRITE_H

#include <vector>

#include "boost/shared_ptr.hpp"

#include "SFML/Graphics.hpp"

#include "Animation.h"

class ResImage;
typedef boost::shared_ptr<ResImage> ResImagePtr;

class AnimatedSprite : public sf::Sprite
{
public:
    AnimatedSprite();
    AnimatedSprite(int imageId); 
	~AnimatedSprite(); //The destructor -- no need to implement at this point since other variables are stack


    void    addAnimation(Animation animation);

    void update(float delta);
    bool playAnimation(int animationId);
    int getImageId() const;
private:
    void setSubRect(int index);
    int animIndexPlayed; //index of current animation in vector of animations
    float frame; //frame of current animation
    int imageId;
    sf::Rect<int>       rect;
    std::vector<Animation> animations;
    //This will be implemented in ResImage
//     int columns;
//     int rows;
//     int frameWidth;
//     int frameHeight;
};

typedef boost::shared_ptr<AnimatedSprite> AnimatedSpritePtr;

#endif